import React from "react";
import PropTypes from "prop-types";
import { NavBar } from 'antd-mobile';
const viewHeader = function viewHeader(props) {
    let { title, navigate } = props;
    const handleBack = () => {
        navigate(-1)
    }
    return <NavBar
        style={{
            '--height': '40px',
            '--border-bottom': '1px #eee solid',
        }}
        // backArrow={!['登录/注册'].includes(title)}
        onBack={handleBack}
    >
        <span style={
            {
                fontSize: '18px',
                fontWeight: 'bold',
                textAlign: 'center',
            }
        }> {title}</span>
    </NavBar>
}

viewHeader.defaultProps = { title: '个人中心'  ,navigate:()=>{}};
viewHeader.propTypes = { title: PropTypes.string  ,navigate:PropTypes.func};
export default viewHeader;